-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PostTitle: exit early when post type doesn't support titles #67086
Conversation
Size Change: +49 B (0%) Total Size: 1.82 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @mijan-xs. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Unlinked contributors: mijan-xs. Co-authored-by: jsnajdr <[email protected]> Co-authored-by: Mamaduka <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: ndiego <[email protected]> Co-authored-by: gziolo <[email protected]> Co-authored-by: SantosGuillamot <[email protected]> Co-authored-by: getdave <[email protected]> Co-authored-by: youknowriad <[email protected]> Co-authored-by: Tropicalista <[email protected]>
Cherry-picked to be in a future 6.7.2 to fix #64814 |
Fixes #64814, my debugging notes are in #64814 (comment)
When the post type doesn't support
title
, exit early from rendering thePostTitle
component. The previous version was setting up all the hooks and whistles needed to render it, but in the end it didn't render theh1
element.The patched version calls
useRichText
and everything else only when the post type support is really there.Note that this patch is merely working around what I believe is a bug in
useRichText
: theuseRichText
hook fails in a subtle way when no element is rendered with theref
that it returns.This patch fixes the bug for me.